// 初始化Socket连接
const initSocket = (namespace) => {
    const socket = io(namespace);
    socket.on('connect', () => console.log('连接服务器成功'));
    socket.on('disconnect', () => console.log('连接断开'));
    return socket;
};

// 通用工具函数
const utils = {
    createElement: (tag, className, text) => {
        const el = document.createElement(tag);
        if (className) el.className = className;
        if (text) el.textContent = text;
        return el;
    }
};